import request from '/@/utils/request';

const module = '/eva'

const path = module + '/plans';

// 查询量问题列表
export function pageList(query: object) {
  return request({
    url:  path + '/page',
    method: 'get',
    params: query
  })
}

// 查询量问题详细
export function getObj(id: string) {
  return request({
    url: path + '/' + id,
    method: 'get'
  })
}

// 新增量问题
export function addObj(data: object) {
  return request({
    url: path ,
    method: 'post',
    data: data
  })
}

// 修改量问题
export function putObj(id: string, data: object) {
  return request({
    url: path + '/' + id,
    method: 'put',
    data: data
  })
}

// 删除量问题
export function delObj(id: string) {
  return request({
    url: path + '/' + id,
    method: 'delete'
  })
}

// 发布测评计划
export function publish(id: string) {
  return request({
    url: path + '/' + id + '/publish',
    method: 'put'
  })
}

export function pageCompletedUsers(query: any) {
  return request({
    url: path + '/' + query.planId + '/completed-users',
    method: 'get',
    params: query
  })
}

